package org.adorsys.aderp.aderplogin.service;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.adorsys.aderp.aderplogin.domain.AderpUser;
import org.adorsys.aderp.aderplogin.domain.UserRole;
import org.springframework.transaction.annotation.Transactional;


public class AderpUserServiceImpl implements AderpUserService {

	@Transactional
	public AderpUser findByUserName(String username){
		List<AderpUser> found = aderpUserRepository.findByUserName(username);
		if(found.isEmpty()) return null;
		AderpUser next = found.iterator().next();
		return new AderpUser(next);
	}
}
